function Get-IpAddressList($server)
{
	$serverIPAddresses = [System.Net.Dns]::GetHostByName("$server") 
	[array]$serverIPlist = $serverIPAddresses.addresslist | %{$_.IpAddressToString}
	return $serverIPlist
	
}

function Is-LocalMachine ($server)
{
	if ($server -eq '127.0.0.1')
	{
		return $True
	}
	else
	{
		$regexp = '\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b'
		if ($server -match $regexp)
		{
			#if the server value is already an IP address just cast as an array
			[array]$serverIPArray = $server
		}
		else
		{
			[array]$serverIPArray = Get-IpAddressList $server
		}
		[array]$localIPArray = Get-IpAddressList $env:computername

		foreach ($ip in $serverIPArray)
		{
			if ($localIPArray -contains $ip)
			{
				return $True
	 		}
		}
	}
	return $false
}